var app = getApp();

Page({
  data: {
    userName: '',
    avatar: '',
    gender: '',
    certification: ''
  },
  onLoad: function(options) {
    var that = this;
    that.setData({
      userName: wx.getStorageSync("userName"),
      avatar: wx.getStorageSync("avatar"),
      certification: wx.getStorageSync("certification") == 'false' ? '未认证' : '已认证'
    });
    that.getData();
  },
  getData: function() {
    var that = this;
    app.JsonPost("Api/User/index", {}, function(res) {
      console.log(res);
      that.setData({
        gender: res.gender,
        mobile: res.mobile == null ? '' : res.mobile,
        weixin: res.weixin == null ? '' : res.weixin
      })
    });
  },
  certification: function() {
    wx.navigateTo({
      url: "../certification/certification"
    })
  }
})